import { multiply } from '@/utils/number'

export const columnProjects = (id) => {
  return [
    {
      prop: 'sort',
      label: '序号'
    },
    {
      prop: 'name',
      label: '收费项目',
      canEdit: !id
    },
    {
      prop: 'price',
      label: '单价',
      type: 'number',
      canEdit: !id,
      width: '140'
    },
    {
      prop: 'number',
      canEdit: true,
      required: true,
      type: 'number',
      label: '数量',
      width: '140'
    },
    {
      prop: 'amount',
      label: '金额',
      render: (row) => multiply(row.price, row.number)
    },
    {
      prop: 'remark',
      canEdit: true,
      required: true,
      label: '项目说明',
      width: '140'
    },
    {
      prop: 'action',
      label: '操作'
    }
  ]
}
